package com.kfm.base.io.b;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class Demo07 {

    public static void main(String[] args) {
        try(FileOutputStream fos = new FileOutputStream("d:/io/file-out-append.txt", true)){
//            fos.write("笔锋何用锐".getBytes());
//            fos.write('\r');
//            fos.write("墨气自然流".getBytes());
//            fos.write('\r');

//            fos.write('a');
//            fos.write('b');


        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        try (FileOutputStream fos = new FileOutputStream("d:/io/file-out-append.txt", true)){
            fos.write("重思薄如纸".getBytes());
            fos.write('\r');
            fos.write("欲写意还休".getBytes());
            fos.write('\r');

        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
